Slight tweaks to CI
authorAlex Crichton <alex@alexcrichton.com>
Wed, 30 Nov 2016 19:12:49 +0000 (11:12 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 1 Dec 2016 06:56:20 +0000 (22:56 -0800)
* Pass `--quiet` to all tests to have some quieter output
* Skip builds on branches other than `auto-cargo` as it's already checked
* Check the right env var for repo branches on appveyor
* Only run a few builds on PRs

.travis.yml
Makefile.in
appveyor.yml
src/ci/docker/run.sh
src/ci/run.sh

index 961c8488c991b95e6d25cdadeeed5645db11b38e..51e50435f8b9bca81f0ad4e6d9c91bc4682fb60c 100644 (file)
@@ -6,6 +6,9 @@ os: linux
 services:
   - docker
 
+git:
+  depth: 1
+
 matrix:
   include:
     # stable linux builds, tested
@@ -13,6 +16,7 @@ matrix:
            ALT=i686-unknown-linux-gnu
            IMAGE=dist
            MAKE_TARGETS="test distcheck doc install uninstall"
+           ALLOW_PR=1
     - env: TARGET=i686-unknown-linux-gnu
            IMAGE=dist
            MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
@@ -99,11 +103,15 @@ before_script:
       sh -s -- --add-target=$ALT --disable-sudo -y --prefix=`rustc --print sysroot`;
     fi
 script:
-  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then
-        SRC=. src/ci/run.sh $TARGET;
-    else
-        src/ci/docker/run.sh $IMAGE $TARGET;
-    fi
+  - >
+      if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto-cargo" ]; then
+          echo skipping, not a full build;
+      elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
+          SRC=. src/ci/run.sh $TARGET;
+      else
+          src/ci/docker/run.sh $IMAGE $TARGET;
+      fi
+
 after_success: |
   [ $TRAVIS_BRANCH = master ] &&
   [ $TRAVIS_PULL_REQUEST = false ] &&
@@ -121,13 +129,6 @@ notifications:
   email:
     on_success: never
 
-branches:
-  only:
-  - master
-  - auto-cargo
-  - beta
-  - stable
-
 before_deploy:
   - mkdir -p deploy/$TRAVIS_COMMIT
   - cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
index 79d9a52e0944deba2164e3ff12f246cc247da739..ef02d4547ba89865a92c23c0f9cfed3bb22ba26c 100644 (file)
@@ -103,7 +103,8 @@ test-unit-$(1): target/openssl/$(1).stamp cargo-$(1)
        @mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
        $$(CARGO) test --target $(1) \
                --manifest-path $(S)Cargo.toml \
-               $$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only)
+               $$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
+               --quiet
 endef
 $(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
 
index 905b35b9c323e935deed32280da03b05710e4c63..cfc59f75d0bb52726aa84056b5ad61837b9622c1 100644 (file)
@@ -1,12 +1,10 @@
 environment:
   matrix:
   - TARGET: x86_64-pc-windows-gnu
-    ARCH: amd64
     BITS: 64
     CFG_DISABLE_CROSS_TESTS: 1
     MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
   - TARGET: i686-pc-windows-gnu
-    ARCH: x86
     BITS: 32
     MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
     MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
@@ -15,13 +13,12 @@ environment:
     MAKE_TARGETS: test-unit-i686-pc-windows-gnu
   - TARGET: i686-pc-windows-msvc
     BITS: 32
-    ARCH: x86
     MAKE_TARGETS: test-unit-i686-pc-windows-msvc
     CFG_DISABLE_CROSS_TESTS: 1
+    ALLOW_PR: 1
   - TARGET: x86_64-pc-windows-msvc
     OTHER_TARGET: i686-pc-windows-msvc
     BITS: 64
-    ARCH: amd64
     MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc
 
 install:
@@ -38,6 +35,8 @@ install:
   - cargo -V
   - git submodule update --init
 
+clone_depth: 1
+
 build: false
 
 test_script:
@@ -48,16 +47,13 @@ cache:
   - C:\Users\appveyor\.cargo\registry
 
 after_test:
-  - mkdir %APPVEYOR_REPO_COMMIT%
+  - ps: New-Item -Path "${env:APPVEYOR_REPO_COMMIT}" -ItemType "directory"
+  - ps: New-Item -Path "target" -ItemType "directory" -Force
+  - ps: New-Item -Path "target/${env:TARGET}" -ItemType "directory" -Force
+  - ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
+  - ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
   - ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}
 
-branches:
-  only:
-  - master
-  - auto-cargo
-  - beta
-  - stable
-
 artifacts:
   - path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
     name: cargo
index 1a0bb0c21c7735ceb58918ab6ff11582ffaa0df4..f0546972be6874127686f0bb7535200342458ad6 100755 (executable)
@@ -37,6 +37,9 @@ exec docker run \
   --env SRC=/checkout \
   --env CARGO_HOME=/cargo \
   --env TRAVIS_BRANCH=$TRAVIS_BRANCH \
+  --env TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
+  --env ALLOW_PR=$ALLOW_PR \
+  --env CI=$CI \
   --volume "$HOME/.cargo:/cargo" \
   --volume `rustc --print sysroot`:/rust:ro \
   --volume `pwd`/target:/tmp/target \
index a532757d9f3d5a3a7ac381d0bbedb66ae80a4209..1f20a7652d9816e713c268411494df1a145c5dfd 100755 (executable)
@@ -19,7 +19,7 @@ fi
 
 BRANCH=$TRAVIS_BRANCH
 if [ "$BRANCH" = "" ]; then
-    BRANCH=$APPVEYOR_BRANCH
+    BRANCH=$APPVEYOR_REPO_BRANCH
 fi
 
 if [ "$BRANCH" = "stable" ]; then
@@ -34,6 +34,19 @@ else
     CHANNEL=dev
 fi
 
+# We want to only run tests in a few situations:
+#
+# * All tests on the auto-cargo branch
+# * One test on PRs
+# * Any tests done locally
+#
+# This means that here if we're on CI, then we skip tests if it's not the right
+# branch or if we're not configured to run a test on PRs
+if [ -n "$CI" ] && [ "$BRANCH" != "auto-cargo" ] && [ "$ALLOW_PR" = "" ]; then
+    echo no build necessary, skipping
+    exit 0
+fi
+
 $SRC/configure \
     --prefix=/tmp/obj/install \
     --target=$TARGET \